package com.mydubbo.rpc;

import java.util.HashMap;
import java.util.Map;

import com.mydubbo.rpc.dto.Response;

public class Rpc {
	
	//requestId
	static Map<String, Rpc> map = new HashMap<>();
	
	private volatile Response response;
	
	public static void putRpc(String id, Rpc rpc) {
		map.put(id, rpc);
	}
	
	public static Rpc getRpc(String id) {
		return map.get(id);
	}
	
	public static Map<String, Rpc> getRpcMap() {
		return map;
	}
	
	public Response getResponse() {
		while(true) {
			if(response!=null) {
				return response;
			}
		}
	}

	public void setResponse(Response response) {
		this.response = response;
	}


}
